<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/store/include/init_store.jsp" %>
<%
	if (!isSeller) {
		response.sendRedirect("/");
		return ;
	}
	
	
	String s_book_name	= StringUtil.nvl(request.getParameter("s_book_name"));
	
	HashMap infos = new HashMap();
	infos.put("publisher_id", session_user_id);
	infos.put("book_name", s_book_name);

	
	PublisherDAO dao = new PublisherDAO();
	HashList list 	= dao.selectBookList(infos);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= HOME_NAME %></title>
	<%@ include file="/home/include/cssnjs.jsp"  %>

	<script type="text/javascript">
	
	
	$(document).ready(function() {
		$('#s_book_name').focus().select();
		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(){
				$(opener.document).find('#book_code').val($(this).closest('tr').find('input[name="book_code"]').val());
				$(opener.document).find('#book_name').text($(this).closest('tr').find('input[name="book_name"]').val());
				self.close();
			});
	});

	function fnSelectDocu() {
		
	}

	</script>
</head>
<body>
<div id="wrap">
	<div id="popup">
		<h2>큐북 선택</h2>

		<div class="clear line_01"></div>

		<form id="searchForm" name="searchForm" action="./selectBook.jsp" method="post" >
	
			<table cellpadding="0" cellspacing="0" class="table_01 mt10">
				<colgroup>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<tr>
						<th><p><label for="docu_name">큐북명</label></p></th>
						<td>
							<input type="text" name="s_book_name" id="s_book_name" value="<%= s_book_name %>" class="w200"/>
						</td>
					</tr>
				</tbody>
			</table>
			
			<div class="r mt5">
				<input type="image" class="button" src="./images/btn_search.gif" align="absmiddle"/>
			</div>
			
		</form>
		
		<div class="mt5">
		
			<table cellpadding="0" cellspacing="0" class="table_01">
				<colgroup>
					<col width="100px"/>
					<col />
				</colgroup>
				<thead>
					<tr>
						<th><p>큐북코드</p></th>
						<th><p>큐북명</p></th> 
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr>
						<td>
							<input type="hidden" name="book_code" value="<%= list.get("book_code", i) %>"/>
							<input type="hidden" name="book_name" value="<%= list.get("book_name", i) %>"/>
							<%= list.get("book_code", i) %>
						</td>
						<td>
							<%= list.get("book_name", i) %>
						</td>
					</tr>
			<%	} %>
				</tbody>
			</table>
		</div>

		<div class="mt20 mb10 c">
			<a href="#nohref" onclick="self.close()"><img src="./images/btn_close.gif" /></a>
		</div>
	
	</div>
</div>

</body>
</html>
